package com.mcflies.ui.listView;

import java.util.List;

import com.mcflies.ui.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class McfliesBaseListViewAdapter extends BaseAdapter {
	private List<String> dataList;
	private Context context;
	private LayoutInflater inflater;

	public McfliesBaseListViewAdapter(List<String> dataList, Context context) {
		this.dataList = dataList;
		this.context = context;
		inflater = LayoutInflater.from(this.context);
	}

	@Override
	public int getCount() {
		return this.dataList.size();
	}

	@Override
	public Object getItem(int position) {
		return this.dataList.get(position);
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	@Override
	public View getView(int position, View view, ViewGroup parent) {
		if (null == view) {
			view = inflater.inflate(R.layout.android_listview_item, null);
			TextView androidListViewItem_TV = (TextView) view
					.findViewById(R.id.androidListViewItem_TV);
			androidListViewItem_TV.setText(this.dataList.get(position));
		}
		return view;
	}

}
